webpackJsonp([9],{0:function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function a(e){return e&&e.__esModule?e:{default:e}}function i(e){k.Push("site",!0)}function o(e,t){e.url&&e.url.includes("#")?g.browser.tabs.query({},function(n){return t(n.filter(function(t){return t.url==e.url&&t.active}))}):g.browser.tabs.query(e,function(e){t(e)})}function s(e,t){var n="";t==-1?(g.browser.pageAction.hide(e),A.Update("tempread")):(n="-enable",g.browser.pageAction.show(e),h.storage.option.menu.read===!0&&A.Create("read"),A.Update("read")),g.browser.pageAction.setIcon({tabId:e,path:g.browser.extension.getURL("assets/images/icon16"+n+".png")})}function u(e,t){N.auth.uid=""==h.storage.user.uid?t:h.storage.user.uid,N.auth.verify(function(t){205==t.code?(N.auth.setToken(t.data),N.auth.setLock(!1,t.status),e&&e()):200==t.code?(N.auth.setLock(!1,t.status),e&&e()):t.code==-1?e&&e():(N.auth.removeToken(),N.auth.setLock(!0,t.status,function(){e&&e(t)}))})}function c(){var e=JSON.parse(localStorage.getItem("simpread_unreader"));e&&1==e.popup?g.browser.tabs.create({url:g.browser.extension.getURL("unreader/main.html?mode=popup"),active:!1},function(t){g.browser.windows.create({tabId:t.id,type:"popup",focused:!0,width:e.size.w,height:e.size.h})}):g.browser.tabs.create({url:g.browser.extension.getURL("simple"==h.storage.option.unreader.show?"options/options.html#later":"unreader/main.html")})}function l(e){var t=e.eventCategory,n=(e.eventAction,e.eventValue);_gaq.push(["_trackEvent",t,n])}function d(){g.browser.runtime.setUninstallURL(h.storage.option.uninstall?h.storage.service+"/uninstall":""),l({eventCategory:"install",eventAction:"install",eventValue:"uninstall"})}var p=n(199),f=a(p),h=n(4),m=n(6),b=r(m),g=n(3),v=n(90),w=r(v),y=n(161),A=r(y),S=n(24),k=r(S),_=n(387),E=r(_),M=n(200),O=r(M),T=n(33),I=r(T),N=n(21),C=n(56),x=a(C),R=-1,G=0;h.storage.Read(function(){h.storage.puread=new x.default(h.storage.sites),f.default.Firstload()?(f.default.Version(w.version),g.browser.tabs.create({url:g.browser.extension.getURL("options/options.html#firstload?ver="+w.version)})):(!f.default.Count()&&h.storage.GetRemote("remote",function(e,t){t||(h.storage.pr.Addsites(e),h.storage.Writesite(h.storage.pr.sites,i))}),w.version!=h.storage.version&&h.storage.GetRemote("local",function(e,t){h.storage.pr.Addsites(e),h.storage.Writesite(h.storage.pr.sites,function(){w.version!=h.storage.version&&h.storage.Fix(h.storage.read.sites,h.storage.version,w.version,h.storage.focus.sites),w.version!=h.storage.version&&h.storage.Write(function(){localStorage.setItem("simpread-pre-version","2.1.0"),f.default.Version(w.version),g.browser.tabs.create({url:g.browser.extension.getURL("options/options.html#update?ver="+w.version)})},w.Verify(h.storage.version,h.storage.simpread)),i(e)})}),w.version==h.storage.version&&w.patch!=h.storage.patch&&f.default.Patch("add",w.patch)),A.CreateAll(),setTimeout(function(){return d()},100),2==h.storage.user.rule&&l({eventCategory:"account",eventAction:"account",eventValue:"pro"})}),A.OnClicked(function(e,t){l({eventCategory:"menu",eventAction:"menu",eventValue:e.menuItemId}),"link"==e.menuItemId?e.linkUrl&&g.browser.tabs.create({url:e.linkUrl+"?simpread_mode=read"}):"manual"==e.menuItemId?g.browser.tabs.sendMessage(t.id,b.Add(b.MESSAGE_ACTION.open_manual,{url:e.pageUrl})):"list"==e.menuItemId||"open_unreader"==e.menuItemId?c():"whitelist"==e.menuItemId?g.browser.tabs.sendMessage(t.id,b.Add(b.MESSAGE_ACTION.menu_whitelist,{url:e.pageUrl})):"exclusion"==e.menuItemId?g.browser.tabs.sendMessage(t.id,b.Add(b.MESSAGE_ACTION.menu_exclusion,{url:e.pageUrl})):"blacklist"==e.menuItemId?g.browser.tabs.sendMessage(t.id,b.Add(b.MESSAGE_ACTION.menu_blacklist,{url:e.pageUrl})):"unrdist"==e.menuItemId?g.browser.tabs.sendMessage(t.id,b.Add(b.MESSAGE_ACTION.menu_unrdist,{url:e.pageUrl})):"lazyload"==e.menuItemId?g.browser.tabs.sendMessage(t.id,b.Add(b.MESSAGE_ACTION.menu_lazyload,{url:e.pageUrl})):"open_shortcuts"==e.menuItemId?g.browser.tabs.create({url:"chrome://extensions/shortcuts"}):"open_docs"==e.menuItemId?g.browser.tabs.create({url:"http://ksria.com/simpread/docs/#/"}):"open_pro"==e.menuItemId?g.browser.tabs.create({url:"http://ksria.com/simpread/docs/#/已购必读"}):"open_option"==e.menuItemId||"option"==e.menuItemId?g.browser.tabs.create({url:g.browser.extension.getURL("options/options.html")}):t.url.startsWith("chrome://")||g.browser.tabs.sendMessage(t.id,b.Add(e.menuItemId))}),chrome.commands.onCommand.addListener(function(e){"open_unreader"==e?c():g.browser.tabs.query({active:!0},function(t){if(t&&t.length>0){var n=t[0],r=void 0;"add_unreader"==e?r=b.MESSAGE_ACTION.menu_unrdist:"read_mode"==e?r=b.MESSAGE_ACTION.read_mode:"focus_mode"==e&&(r=b.MESSAGE_ACTION.focus_mode),g.browser.tabs.sendMessage(n.id,b.Add(r))}})}),g.browser.runtime.onMessage.addListener(function(e,t,n){return e.type==b.MESSAGE_ACTION.CORB&&$.ajax(e.value.settings).done(function(e){n({done:e})}).fail(function(e,t,r){n({fail:{jqXHR:e,textStatus:t,errorThrown:r}})}),!0}),g.browser.runtime.onMessage.addListener(function(e,t,n){if(e.type==b.MESSAGE_ACTION.CORB2){if(""==N.auth.token||2!=h.storage.user.rule)return void n({done:{code:401,status:"uid"}});N.auth.getFinger(function(t){e.value.settings.headers={uid:h.storage.user.uid,finger:t},$.ajax(e.value.settings).done(function(e){n({done:e})}).fail(function(e,t,r){n({fail:{jqXHR:e,textStatus:t,errorThrown:r}})})})}return!0}),g.browser.runtime.onMessage.addListener(function(e,t,n){e.type==b.MESSAGE_ACTION.jianguo&&!function(){var t=e.value,r=t.url,a=t.user,i=t.password,o=t.method,s=new E.Fs(r,a,i);"folder"==o.type?s.dir(o.root).mkdir(function(e){s.dir(o.root+"/"+o.folder).mkdir(function(e){n({done:e,status:e.status})})}):"file"==o.type?s.file(o.path).write(o.content,function(e){n({done:e,status:e.status})}):"read"==o.type&&s.file(o.path).read(function(e){n({done:e.response,status:e.status})})}()}),g.browser.runtime.onMessage.addListener(function(e,t,n){if(e.type==b.MESSAGE_ACTION.WebDAV){var r=e.value,a=r.url,i=r.user,o=r.password,s=r.method,u=new E.Fs(a,i,o);"folder"==s.type?u.dir(s.root).mkdir(function(e){n({done:e,status:e.status})}):"file"==s.type&&u.file(s.root+"/"+s.name).write(s.content,function(e){n({done:e,status:e.status})})}}),g.browser.runtime.onMessage.addListener(function(e,t,n){if(e.type==b.MESSAGE_ACTION.download){var r=e.value,a=r.data,i=r.name,o=new Blob([a],{type:"html/plain;charset=utf-8"}),s=URL.createObjectURL(o);g.browser.downloads.download({url:s,filename:i.replace(/[|]|:|\?/gi,"")},function(e){n({done:e})})}else e.type==b.MESSAGE_ACTION.base64?!function(){var t=e.value.url;fetch(t).then(function(e){return e.blob()}).then(function(e){return new Promise(function(r,a){var i=new FileReader;i.onloadend=function(e){n({done:{url:t,uri:e.target.result}})},i.onerror=function(e){n({fail:{error:e,url:t}})},i.readAsDataURL(e)})}).catch(function(e){n({fail:{error:e,url:t}})})}():e.type==b.MESSAGE_ACTION.permission&&O.Get({permissions:["downloads"]},function(e){n({done:e})});return!0}),g.browser.runtime.onMessage.addListener(function(e,t,n){return e.type==b.MESSAGE_ACTION.snapshot&&!function(){var t=e.value,r=t.left,a=t.top,i=t.width,o=t.height;chrome.tabs.captureVisibleTab({format:"png"},function(e){var t=new Image;t.src=e,t.onload=function(){var e=document.createElement("canvas"),s=e.getContext("2d"),u=window.devicePixelRatio,c=r*u,l=a*u,d=i*u,p=o*u;e.width=d,e.height=p,s.drawImage(t,c,l,d,o*u,0,0,d,p);var f=e.toDataURL("image/png");n({done:f})}})}(),!0}),g.browser.runtime.onMessage.addListener(function(e,t,n){switch(e.type){case b.MESSAGE_ACTION.shortcuts:o({url:e.value.url},function(e){g.browser.tabs.sendMessage(e[0].id,b.Add(b.MESSAGE_ACTION.shortcuts))});break;case b.MESSAGE_ACTION.browser_action:o({url:e.value.url},function(t){t&&t.length>0&&t[0].url==e.value.url&&s(t[0].id,e.value.code)});break;case b.MESSAGE_ACTION.new_tab:g.browser.tabs.create({url:e.value.url});break;case b.MESSAGE_ACTION.close_tab:o({active:!0},function(t){t.forEach(function(t){t.active&&t.url==e.value.url&&g.browser.tabs.remove(t.id)})});break;case b.MESSAGE_ACTION.menu:var r=e.value,a=r.id,i=r.value;h.storage.option.menu[a]=i,i===!0?A.Create(a):A.Remove(a);break;case b.MESSAGE_ACTION.updated:k.Push(e.value.type,e.value.value);break;case b.MESSAGE_ACTION.save_verify:n(k.Lock(e.value.url));break;case b.MESSAGE_ACTION.auth:g.browser.tabs.create({url:g.browser.extension.getURL("options/options.html#connect?auth="+e.value.name.toLowerCase())});break;case b.MESSAGE_ACTION.update_site:o({active:!0,url:e.value.url},function(t){t.length>0&&(R=t[0].id),g.browser.tabs.create({url:g.browser.extension.getURL("options/options.html#sites?update="+encodeURI(JSON.stringify(e.value.site)))})});break;case b.MESSAGE_ACTION.auth_success:o({url:e.value.url},function(t){t&&t.length>0&&(g.browser.tabs.remove(t[0].id),o({active:!0},function(t){t.forEach(function(t){return g.browser.tabs.sendMessage(t.id,b.Add(b.MESSAGE_ACTION.export,{type:e.value.name.toLowerCase()}))})}))});break;case b.MESSAGE_ACTION.track:l(e.value);break;case b.MESSAGE_ACTION.speak:g.browser.tts.speak(e.value.content);break;case b.MESSAGE_ACTION.speak_stop:g.browser.tts.stop();break;case b.MESSAGE_ACTION.tips:if("pre-version"==e.value.type){var u=localStorage.getItem("simpread-pre-version")||"";I.Verify(u+"::"+e.value.code,function(e){n({version:localStorage.getItem("simpread-pre-version"),tips:e})})}else I.Verify(e.value.code,n);break;case b.MESSAGE_ACTION.tips_norepeat:I.Done(e.value.code);break;case b.MESSAGE_ACTION.promo_storage:var c=localStorage.getItem("simpread-promo-storage"),d=localStorage.getItem("simpread-promo-date")||+new Date;n({promo:c,date:d});break;case b.MESSAGE_ACTION.promo:if("write"==e.value.type){var p=JSON.parse(localStorage["simpread-promo"]||"{}");p[e.value.id]=e.value.status,localStorage.setItem("simpread-promo",JSON.stringify(p))}else{var f=JSON.parse(localStorage["simpread-promo"]||"{}");n(f[e.value.id])}break;case b.MESSAGE_ACTION.open_urlscheme:o({active:!0,url:e.value.url},function(t){t&&t.length>0&&g.browser.tabs.sendMessage(t[0].id,b.Add(b.MESSAGE_ACTION.menu_whitelist,{url:e.value.url}))})}}),g.browser.runtime.onMessage.addListener(function(e,t,n){return e.type==b.MESSAGE_ACTION.verify_rule?"now"==e.value.type?N.auth.getLock(function(){u(n,e.value.uid)}):(G++,N.auth.getLock(function(){N.auth.lock?n({code:N.auth.lock,status:N.auth.lock_status}):G>=10&&(G=0,u(n,e.value.uid))})):e.type==b.MESSAGE_ACTION.sync_rule&&(N.auth.getToken(),Object.keys(h.storage.simpread.user).forEach(function(t){return h.storage.simpread.user[t]=e.value.user[t]})),!0}),g.browser.tabs.onActivated.addListener(function(e){o({active:!0,currentWindow:!0},function(e){e&&e.length>0&&"complete"==e[0].status&&(e&&e.length>0&&!e[0].url.startsWith("chrome://")?g.browser.tabs.sendMessage(e[0].id,b.Add(b.MESSAGE_ACTION.tab_selected,{is_update:!1})):s(e[0].id,-1))})}),g.browser.tabs.onUpdated.addListener(function(e,t,n){if(k.Pull(e),"complete"==t.status){if(n.url.startsWith("http://ksria.com/simpread/auth.html")||n.url.startsWith("https://simpread.pro/auth.html"))!function(){var t=n.url.replace("http://ksria.com/simpread/auth.html?id=","").replace("https://simpread.pro/auth.html?id=",""),r=t.includes("#")||t.includes("&")?t.substr(0,t.search(/\S(#|&)/)+1):t;g.browser.tabs.query({},function(t){var a=t.find(function(e){return e.url.includes(g.browser.extension.getURL("options/options.html"))});a&&(g.browser.tabs.sendMessage(a.id,b.Add(b.MESSAGE_ACTION.redirect_uri,{uri:n.url,id:r})),g.browser.tabs.remove(e))})}();else if(n.url.startsWith("https://simpread.ksria.cn/plugins/install/")){var r=n.url.replace("https://simpread.ksria.cn/plugins/install/","");g.browser.tabs.create({url:g.browser.extension.getURL("options/options.html#plugins?install="+encodeURIComponent(r))}),g.browser.tabs.remove(e)}else if(n.url.startsWith("https://simpread.ksria.cn/sites/install/")){var a=n.url.replace("https://simpread.ksria.cn/sites/install/","");g.browser.tabs.create({url:g.browser.extension.getURL("options/options.html#sites?install="+encodeURIComponent(a))}),g.browser.tabs.remove(e)}else n.url==g.browser.runtime.getURL("options/options.html#sites?update=success")?(g.browser.tabs.remove(e),R>0&&chrome.tabs.reload(R,function(){})):n.url==g.browser.runtime.getURL("options/options.html#sites?update=failed")?g.browser.tabs.remove(e):n.url==g.browser.runtime.getURL("options/options.html#sites?update=complete")&&g.browser.tabs.remove(e);n.url.startsWith("chrome://")?s(n.id,-1):g.browser.tabs.sendMessage(e,b.Add(b.MESSAGE_ACTION.tab_selected,{is_update:!0}))}}),g.browser.tabs.onRemoved.addListener(function(e){return k.Pull(e)}),g.browser.pageAction.onClicked.addListener(function(e){g.browser.tabs.sendMessage(e.id,b.Add(b.MESSAGE_ACTION.browser_click))})},21:function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}),t.auth=void 0;var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(4),o=function(){function e(){r(this,e),this.uid=void 0,this.finger=void 0,this.getToken(),this.getLock()}return a(e,[{key:"setLock",value:function(e,t,n){var r=this;i.storage.Lock({lock:e,status:t},function(){r.lock=e,r.lock_status=t,n&&n()})}},{key:"getLock",value:function(e){var t=this;i.storage.Lock(void 0,function(n){t.lock=!n||n.lock,t.lock_status=n?n.status:void 0,e&&e()},"read")}},{key:"removeLock",value:function(){this.lock=!1,this.lock_status=void 0,i.storage.Lock(void 0,function(e){},"remove")}},{key:"setToken",value:function(e){this.token=e,i.storage.Token(this.token,function(e){})}},{key:"getToken",value:function(){var e=this;i.storage.Token(void 0,function(t){e.token=t},"read")}},{key:"removeToken",value:function(){this.token=void 0,i.storage.Token(this.token,function(e){},"remove")}},{key:"getFinger",value:function(e){var t=function(e){var t,n,r,a="";for(e+="",t=0,n=e.length;t<n;t++)r=e.charCodeAt(t).toString(16),a+=r.length<2?"0"+r:r;return a},n=function(e){var n=document.createElement("canvas"),r=n.getContext("2d"),a=e;r.textBaseline="top",r.font="14px 'Arial'",r.textBaseline="tencent",r.fillStyle="#f60",r.fillRect(125,1,62,20),r.fillStyle="#069",r.fillText(a,2,15),r.fillStyle="rgba(102, 204, 0, 0.7)",r.fillText(a,4,17);var i=n.toDataURL().replace("data:image/png;base64,",""),o=atob(i),s=t(o.slice(-16,-12));return s};e&&e(n("https://www.baidu.com/"))}},{key:"verifyHeader",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return this.uid?e?!(!n&&!this.token&&(t({code:403,status:-1010}),1)):(t({code:403,status:-1009}),!1):(t({code:403,status:-1008}),!1)}},{key:"registry",value:function(e){var t=this;this.getFinger(function(n){$.ajax({url:t.endpoint+"/invites/service/authentication/",method:"POST",headers:{finger:n,authentication:t.license,uid:t.uid}}).done(function(t,n,r){e(t)}).fail(function(t){e({code:-1,data:t})})})}},{key:"login",value:function(e){var t=this;this.getFinger(function(n){t.verifyHeader(n,e,!0)&&$.ajax({url:t.endpoint+"/accounts/service/login/",method:"POST",headers:{finger:n,token:t.token,uid:t.uid}}).done(function(t,n,r){e(t)}).fail(function(t){e({code:-1,data:t})})})}},{key:"logout",value:function(e){var t=this;this.getFinger(function(n){t.verifyHeader(n,e)&&$.ajax({url:t.endpoint+"/accounts/service/logout/",method:"POST",headers:{finger:n,token:t.token,uid:t.uid}}).done(function(t,n,r){e(t)}).fail(function(t){e({code:-1,data:t})})})}},{key:"verify",value:function(e){var t=this;this.getFinger(function(n){t.verifyHeader(n,e)&&$.ajax({url:t.endpoint+"/accounts/service/verify/",method:"POST",headers:{finger:n,token:t.token,uid:t.uid}}).done(function(t,n,r){e(t)}).fail(function(t){e({code:-1,data:t})})})}},{key:"reset",value:function(e,t){$.ajax({url:this.endpoint+"/accounts/service/reset/",method:"POST",data:{sn:e}}).done(function(e,n,r){t(e)}).fail(function(e){t({code:-1,data:e})})}},{key:"code",get:function(){return{verify:{"-1":"后台操作异常，请稍后再试。"},login:{"-1":"由于后台异常导致恢复购买失败，请稍后再试。"},logout:{"-1":"登出时出现错误，请稍候再试。"},401:"异常登录，请重新确认。","-1001":"一个账户仅能绑定一个密钥。","-1002":"非法登录，如果因为价格的因素，可以联系管理员。","-1003":"在相同时间内您登录了过多的浏览器，此账户已被锁定，请联系管理员解锁。","-1004":"非法验证，如果因为价格的因素，可以联系管理员。","-1005":"当前账户的权限存在异常，请联系管理员。","-1006":"异常退出，请确保此设备已登录。","-1007":"您使用此账户登录了过多的浏览器，请联系管理员或登出已登录的设备。","-1008":"当前设备出现了授权异常（尤其是刚付费且首次授权时），不要担心，请重启浏览器再重新授权即可。","-1009":"当前设备验证错误，请稍后再试，仍无法验证请联系管理员。","-1010":"当前设备未授权，如您是高级账户请通过恢复购买获取您的权益","-1011":"您还不是高级账户，请先购买高级账户资格"}}},{key:"endpoint",get:function(){return i.storage.service}}]),e}(),s=new o;t.auth=s},33:function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function a(e){return e&&e.__esModule?e:{default:e}}function i(e){var t=function(e){(new p.default).Render(r[e],"不再提示",function(){m.browser.runtime.sendMessage(h.Add(h.MESSAGE_ACTION.tips_norepeat,{code:e}))})},n=function(e){m.browser.runtime.sendMessage(h.Add(h.MESSAGE_ACTION.tips,{code:e}),function(n){n&&t(e)})},r={klGUASLasg:'检测到当前环境有代码段，请使用      <a target="blank" href="https://simpread.ksria.cn/plugins/details/klGUASLasg">代码增强插件</a> 辅助阅读',VQOZdNET2d:'检测到当前环境有大量的图片，可以使用 <a target="blank" href="https://simpread.ksria.cn/plugins/details/VQOZdNET2d">点击查看大图</a> 辅助阅读',DxlFcL52iy:'如果你想换个论坛类页面风格，可以使用 <a target="blank" href="https://simpread.ksria.cn/plugins/details/DxlFcL52iy">Materail Design 风格</a> 辅助阅读'};$("sr-read").find("pre").length>0&&e.findIndex(function(e){return"klGUASLasg"==e})==-1&&n("klGUASLasg"),$("sr-read").find("img").length>5&&e.findIndex(function(e){return"VQOZdNET2d"==e})==-1&&n("VQOZdNET2d"),"www.zhihu.com"==location.hostname&&location.pathname.startsWith("/question/")&&e.findIndex(function(e){return"DxlFcL52iy"==e})==-1&&n("DxlFcL52iy")}function o(e,t){"statistics"==e&&1==t.read?(new p.default).Render({content:"嗨，很高兴第一次使用简悦的阅读模式，建议看看新手帮助？",action:"我要看",cancel:"老司机",callback:function(e){"action"==e&&m.browser.runtime.sendMessage(h.Add(h.MESSAGE_ACTION.new_tab,{url:"http://ksria.com/simpread/guide/#readmode"})),"cancel"==e&&m.browser.runtime.sendMessage(h.Add(h.MESSAGE_ACTION.tips_norepeat,{code:"readmode"}))}}):"epub"==e?m.browser.runtime.sendMessage(h.Add(h.MESSAGE_ACTION.tips,{code:e}),function(e){e&&(new p.default).Render({type:2,content:'嗨，简悦内置了 <a target="blank" href="http://ksria.com/simpread/docs/#/Sync?id=epub"><b>原生了 Epub 转换方式</b></a>，请升级为高级账户即刻拥有此功能。',action:"升级",cancel:"不再提示",state:"holdon",callback:function(e){"action"==e&&m.browser.runtime.sendMessage(h.Add(h.MESSAGE_ACTION.new_tab,{url:m.browser.extension.getURL("options/options.html#account?mode=upgrade")})),"cancel"==e&&m.browser.runtime.sendMessage(h.Add(h.MESSAGE_ACTION.tips_norepeat,{code:"epub"}))}})}):"enhance_epub"==e?m.browser.runtime.sendMessage(h.Add(h.MESSAGE_ACTION.tips,{code:e}),function(e){e&&(new p.default).Render({type:2,content:'嗨，简悦 <b>高级账户</b> 内置了 <a target="blank" href="http://ksria.com/simpread/docs/#/Sync?id=epub"><b>原生了 Epub 转换方式</b></a>，有需要的话请前往开启此功能。',action:"开启",cancel:"不再提示",state:"holdon",callback:function(e){"action"==e&&m.browser.runtime.sendMessage(h.Add(h.MESSAGE_ACTION.new_tab,{url:m.browser.extension.getURL("options/options.html#connect?anchor=增强导出")})),"cancel"==e&&m.browser.runtime.sendMessage(h.Add(h.MESSAGE_ACTION.tips_norepeat,{code:"enhance_epub"}))}})}):"pdf"==e?m.browser.runtime.sendMessage(h.Add(h.MESSAGE_ACTION.tips,{code:e}),function(e){e&&(new p.default).Render({type:2,content:'嗨，简悦内置了 <a target="blank" href="http://ksria.com/simpread/docs/#/Sync?id=pdf"><b>原生了 PDF 转换方式</b></a>，升级为高级账户即刻拥有此功能。',action:"升级",cancel:"不再提示",state:"holdon",callback:function(e){"action"==e&&m.browser.runtime.sendMessage(h.Add(h.MESSAGE_ACTION.new_tab,{url:m.browser.extension.getURL("options/options.html#account?mode=upgrade")})),"cancel"==e&&m.browser.runtime.sendMessage(h.Add(h.MESSAGE_ACTION.tips_norepeat,{code:"pdf"}))}})}):"enhance_pdf"==e?m.browser.runtime.sendMessage(h.Add(h.MESSAGE_ACTION.tips,{code:e}),function(e){e&&(new p.default).Render({type:2,content:'嗨，简悦 <b>高级账户</b> 内置了 <a target="blank" href="http://ksria.com/simpread/docs/#/Sync?id=pdf"><b>原生了 PDF 转换方式</b></a> ，有需要的话请前往开启此功能。',action:"开启",cancel:"不再提示",state:"holdon",callback:function(e){"action"==e&&m.browser.runtime.sendMessage(h.Add(h.MESSAGE_ACTION.new_tab,{url:m.browser.extension.getURL("options/options.html#connect?anchor=增强导出")})),"cancel"==e&&m.browser.runtime.sendMessage(h.Add(h.MESSAGE_ACTION.tips_norepeat,{code:"enhance_pdf"}))}})}):"plain"==e?m.browser.runtime.sendMessage(h.Add(h.MESSAGE_ACTION.tips,{code:e}),function(e){e&&(new p.default).Render({type:2,content:'嗨，简悦 2.1 增加了 <a target="blank" href="http://ksria.com/simpread/docs/#/Sync?id=导出服务"><b>增强导出功能</b></a> 可保存到本地任意位置，升级为高级账户即刻拥有此功能。',action:"升级",cancel:"不再提示",state:"holdon",callback:function(e){"action"==e&&m.browser.runtime.sendMessage(h.Add(h.MESSAGE_ACTION.new_tab,{url:m.browser.extension.getURL("options/options.html#account?mode=upgrade")})),"cancel"==e&&m.browser.runtime.sendMessage(h.Add(h.MESSAGE_ACTION.tips_norepeat,{code:"plain"}))}})}):"enhance_plain"==e?m.browser.runtime.sendMessage(h.Add(h.MESSAGE_ACTION.tips,{code:e}),function(e){e&&(new p.default).Render({type:2,content:'嗨，简悦 <b>高级账户</b> 内置了 <a target="blank" href="http://ksria.com/simpread/docs/#/Sync?id=导出服务"><b>增强导出功能</b></a> 可保存到本地任意位置。',action:"开启",cancel:"不再提示",state:"holdon",callback:function(e){"action"==e&&m.browser.runtime.sendMessage(h.Add(h.MESSAGE_ACTION.new_tab,{url:m.browser.extension.getURL("options/options.html#connect?anchor=增强导出")})),"cancel"==e&&m.browser.runtime.sendMessage(h.Add(h.MESSAGE_ACTION.tips_norepeat,{code:"enhance_plain"}))}})}):"VQOZdNET2d_disable"==e?m.browser.runtime.sendMessage(h.Add(h.MESSAGE_ACTION.tips,{code:e}),function(e){e&&(new p.default).Render({type:2,content:"嗨，当选择了 <b>浮动标注栏为点击打开</b> 时下无法使用 <b>点击查看大图</b> 插件。",cancel:"不再提示",state:"holdon",callback:function(e){"cancel"==e&&m.browser.runtime.sendMessage(h.Add(h.MESSAGE_ACTION.tips_norepeat,{code:"VQOZdNET2d_disable"}))}})}):"ctrl+c"==e?m.browser.runtime.sendMessage(h.Add(h.MESSAGE_ACTION.tips,{code:e}),function(e){e&&(new p.default).Render({type:2,content:"嗨，在标注模式下，使用 <b>复制</b> 功能会有复制不完整的情况，建议退出标注模式（支持快捷键）后使用。",cancel:"不再提示",state:"holdon",callback:function(e){"cancel"==e&&m.browser.runtime.sendMessage(h.Add(h.MESSAGE_ACTION.tips_norepeat,{code:"ctrl+c"}))}})}):"annote_order"==e&&m.browser.runtime.sendMessage(h.Add(h.MESSAGE_ACTION.tips,{code:e}),function(e){e&&(new p.default).Render({type:2,content:"嗨，简悦 2.2 新增了 <b>标注自动排序</b> 功能。",cancel:"不再提示",action:"更改",callback:function(e){"action"==e&&m.browser.runtime.sendMessage(h.Add(h.MESSAGE_ACTION.new_tab,{url:m.browser.extension.getURL("options/options.html#labs?anchor=标注")})),"cancel"==e&&m.browser.runtime.sendMessage(h.Add(h.MESSAGE_ACTION.tips_norepeat,{code:"annote_order"}))}})})}function s(e){!b&&m.browser.runtime.sendMessage(h.Add(h.MESSAGE_ACTION.tips,{code:"unreader"}),function(t){t&&(new p.default).Render({content:"嗨，欢迎使用 <b>全新的标注及稍后读</b> 系统，建议看看新手帮助？",action:"我要看",cancel:"老司机",callback:function(t){"action"==t&&e&&e(),m.browser.runtime.sendMessage(h.Add(h.MESSAGE_ACTION.tips_norepeat,{code:"unreader"})),b=!1}})}),b=!0}function u(e){var t=function(e){m.browser.runtime.sendMessage(h.Add(h.MESSAGE_ACTION.tips,{code:e,type:"pre-version"}),function(t){t.version&&t.tips&&r(t.version,e)})},n={"2.1.0":{annote:'嗨，<a target="blank" href="https://simpread.pro/welcome/version_2.2.0.html"><b>简悦 2.2.0 ↗</b></a> 标注多种更新，包括：自动排序，浮动工具栏显示方式可更改，可同时导出标注 + 全文等，更多细节 <a target="blank" href="https://simpread.pro/welcome/version_2.2.0.html#annote"><b>请看这里</b></a>。',fap:'嗨，<a target="blank" href="https://simpread.pro/welcome/version_2.2.0.html"><b>简悦 2.2.0 ↗</b></a> 全新的 <b>浮动控制面板</b>：布局更合理，功能更集中，更适合新手用户。</br>可随时切换到 <b>旧版模式</b>（选项页 → 高级设定 → 阅读模式 ）',unreader:'嗨，<a target="blank" href="https://simpread.pro/welcome/version_2.2.0.html"><b>简悦 2.2.0 ↗</b></a> 稍后读大更新，包括：反向链接，知识图谱，Mindmap 查看，离线功能等，更多细节 <a target="blank" href="https://simpread.pro/welcome/version_2.2.0.html#unreader"><b>请看这里</b></a>。',sync:'嗨，<a target="blank" href="https://simpread.pro/welcome/version_2.2.0.html"><b>简悦 2.2.0 ↗</b></a> 同步助手更新，包括：优化扩展端读取速度，读取离线文件，修改 PDF 图片无法显示的问题，Dock 栏图标可隐藏等，更多细节 <a target="blank" href="https://simpread.pro/welcome/version_2.2.0.html#sync"><b>请看这里</b></a>。<br>请使用同步助手的用户 <b>务必更新</b>，<a target="blank" href="http://ksria.com/simpread/docs/#/Sync?id=下载"><b>下载地址 ↗</b>。',option:"<b>全新的选项页</b>，包括：</br>1. <b>导入/导出与同步助手相关的配置文件</b> 放在一处。</br>2. 全新的 <b>服务标签页</b>。</br>3. 除了左侧导航外，还加入了 <b>右侧目录</b> 导航功能。",labs:'<b>简悦 2.2.0 </b> 新增如下功能：</br>1. <b>自动聚焦模式</b>。</br>2. <b>自动暗色模式</b>。</br>3. <b>任意内容生成阅读模式</b>。</br>4. 更易用的 <b>标注</b>，详细说明 <a target="blank" href="https://simpread.pro/welcome/version_2.2.0.html#annote"><b>请看这里</b>。</br>5. 更易用的 <b>稍后读</b>，详细说明 <a target="blank" href="https://simpread.pro/welcome/version_2.2.0.html#unreader"><b>请看这里</b>。</br>6. 整理了 <b>黑名单 / 白名单 / 排除列表</b> 到全局。</br>请通过右侧目录跳转到相应功能。',connect:'全新的 <b>服务标签页</b>，管理简悦全部的导出服务，包括：<b>授权管理</b> · <b>同步助手的增强导出功能 / 发送邮件</b> · <b>定制化 Markdown</b> · <b>API</b> <b>Webhook</b> 等，关于这些功能 <a target="blank" href="http://ksria.com/simpread/docs/#/服务"><b>请看这里 ↗</b></a>。',account:'嗨，<a target="blank" href="https://simpread.pro/welcome/version_2.2.0.html"><b>简悦 2.2.0 ↗</b></a> 用户信息增加了 <b>修改功能</b>，适合 <a target="blank" href="https://github.com/Kenshin/simpread/discussions/1958"><b>找回 UID 后快速绑定 ↗</b></a>。</br>简悦增加了 <b>Newsletter</b>，包括：不定期会推送简悦的用法，版本更新等相关信息，请通过 <b>右侧目录订阅</b>。关于简悦更多的订阅渠道 <a target="blank" href="https://simpread.pro/subscribe"><b>请看这里 ↗</b></a>。'}},r=function(e,t){(new p.default).Render({type:1,content:n[e][t],action:"不再提示",state:"holdon",callback:function(n){"action"==n&&m.browser.runtime.sendMessage(h.Add(h.MESSAGE_ACTION.tips_norepeat,{code:e+"::"+t}))}})};t(e)}function c(e,t){var n=JSON.parse(localStorage["simpread-tips"]||"{}");t(!n[e])}function l(e){var t=JSON.parse(localStorage["simpread-tips"]||"{}");t[e]=!0,localStorage.setItem("simpread-tips",JSON.stringify(t))}Object.defineProperty(t,"__esModule",{value:!0}),t.Annotate=t.Update=t.Help=t.Done=t.Verify=t.Render=void 0;var d=n(7),p=a(d),f=n(6),h=r(f),m=n(3),b=!1;t.Render=i,t.Verify=c,t.Done=l,t.Help=o,t.Update=u,t.Annotate=s},56:function(e,t,n){var r,a,i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};!function(o,s){"object"==i(t)&&"undefined"!=typeof e?e.exports=s():(r=s,a="function"==typeof r?r.call(t,n,t,e):r,!(void 0!==a&&(e.exports=a)))}(void 0,function(){"use strict";function e(e){return $.extend(!0,{},e)}function t(e){if(document){var t=document.createElement("a");return t.href=e,t}var n=e.match(/^(https?\:)\/\/(([^:\/?#]*)(?:\:([0-9]+))?)([\/]{0,1}[^?#]*)(\?[^#]*|)(#.*|)$/);return n&&{href:e,protocol:n[1],host:n[2],hostname:n[3],port:n[4],pathname:n[5],search:n[6],hash:n[7]}}function n(e){if(""==e)return[0,e];if(a(e))return[2,e];var t=e.match(/<\S+ (class|id)=("|')?[\w-_=;:' ]+("|')?>?$|<[^/][-_a-zA-Z0-9]+>?$/gi);return t&&t.length>0?[1,t]:[-1,void 0]}function r(e){var t=n(e),r=A(t,2),a=r[0],i=r[1];if(2==a)return e;if(1==a){var o=i[0].trim().replace(/['"<>]/g,"").replace(/ /gi,"=").split("="),s=A(o,3),u=s[0],c=s[1],l=s[2];return c?"class"===c.toLowerCase()?c=u+"."+l:"id"===c.toLowerCase()&&(c=u+"#"+l):c=u,c}return null}function a(e){return/^(\[\[)[\[{`'/]{1}[ \S]+[}`'/\]]\]\]{1}($)/g.test(e)}function o(e){var t=[e.replace(/(^)\[\[|\]\]$/g,"")],n=t[0],r=t[1];switch(n[0]){case"{":n=n.replace(/^{|}$/g,""),e=new Function("return "+n)(),r=0;break;case"'":e=(e=n.replace(/^'|'$/g,"")).match(/^<[a-zA-Z0-9_-]+>/g).join("").replace(/<|>/g,"")+":contains("+e.replace(/<[/a-zA-Z0-9_-]+>/g,"")+")",r=1;break;case"/":e=n.replace(/^\/|\/$/g,"").replace(/\\{2}/g,"\\").replace(/'/g,'"'),r=2;break;case"[":n=n.replace(/^{|}$/g,""),e=new Function("return "+n)()[0],r=3;break;case"`":n=u(n=n.replace(/^`|`$/g,"")),e=$(n),r=4;break;default:r=-1}return[e,r]}function s(e){try{if(""!=e.id)return void 0==e.id?"":"//*[@id='"+e.id+"']";if(e===document.body)return"/html[1]/"+e.tagName.toLowerCase();for(var t=0,n=e.parentNode.childNodes,r=0;r<n.length;r++){var a=n[r];if(a===e)return s(e.parentNode)+"/"+e.tagName.toLowerCase()+"["+(t+1)+"]";1===a.nodeType&&a.tagName===e.tagName&&t++}}catch(e){return""}}function u(e){return document.evaluate(e,document,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue}function c(){var e=$("body"),t=!0,n=!1,r=void 0;try{for(var a,i=["[itemprop='articleBody']","article",".post-content",".entry-content",".post-article",".content-post",".article-entry",".article-content",".article-body",".markdown-body",".post",".content"][Symbol.iterator]();!(t=(a=i.next()).done);t=!0){var o=a.value,s=e.find(o);if(s.length>0)return s}}catch(e){n=!0,r=e}finally{try{!t&&i.return&&i.return()}finally{if(n)throw r}}return-1}function l(){var e=document.location,t=(e.href,e.host,e.protocol,e.host,e.protocol.substr(0,e.protocol.indexOf(":")),e.protocol,e.host,e.pathname.substr(0,e.pathname.lastIndexOf("/")+1),new E.Readability(document.cloneNode(!0)).parse());return t}function d(n,r,a){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],o=function(e){var t=e.replace("www.","").match(/\.\S+\.\S+/g);return t?t[0].substr(1):e.replace("www.","")},s=t(O),u=[].concat(S(r.keys())),c=a.match(/[.a-zA-z0-9-_]+/g)[1].replace("www.",""),l=o(s.hostname),d=function(){return"/"==s.pathname||/\/(default|index|portal).[0-9a-zA-Z]+$/.test(s.pathname)},p=!0,f=!1,h=void 0;try{for(var m,b=u[Symbol.iterator]();!(p=(m=b.next()).done);p=!0){var g=m.value,v=r.get(g).name,w=o(v);g.startsWith("[[/")&&g.endsWith("/]]")&&new RegExp(g.replace(/^\[\[\/|\/\]\]/g,"")).test(location.href)?i.push([g,e(r.get(g)),n]):d()||g.endsWith("*")||g.replace(/^http[s]?:/,"")!=a.replace(/^http[s]?:/,"")?g.match(/\*/g)&&1==g.match(/\*/g).length&&!d()&&g.endsWith("*")&&c.includes(w)&&l==w&&a.includes(v)?i.push([g,e(r.get(g)),n]):_(s.origin+s.pathname,g)&&i.push([g,e(r.get(g)),n]):i.push([g,e(r.get(g)),n])}}catch(e){f=!0,h=e}finally{try{!p&&b.return&&b.return()}finally{if(f)throw h}}}function p(e){if(!e.name||!e.url||!e.include)return-1;if(-1==n(e.title)[0]||-1==n(e.include)[0]||-1==n(e.desc)[0])return-2;if(e.paging){if(2!=e.paging.length)return-3;if(!e.paging[0].prev)return-4;if(!e.paging[1].next)return-5;if(-1==n(e.paging[0].prev)[0]||-1==n(e.paging[1].next)[0])return-6}if(e.avatar){if(2!=e.avatar.length)return-7;if(!e.avatar[0].name)return-8;if(!e.avatar[1].url)return-9;if(-1==n(e.avatar[0].name)[0]||-1==n(e.avatar[1].url)[0])return-10}return 0}function f(e){var t=e.replace('<div id="readability-page-1" class="page">',""),n=$(t)[0],r=n.outerHTML.replace(n.innerHTML,""),a=$(r)[0],i=a.tagName.toLowerCase(),o=a.className;return{id:a.id,cls:o,tag:i}}function h(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"text",n=$("html");if(a(e)){var r=o(e),i=A(r,2),s=i[0],u=i[1];0==u?e=s:3==u?e=m(n.find(s)):4==u&&(e=s.html())}else"html"==t?e=m(n.find(e)):"multi"==t||(e=n.find(e).text().trim());return e}function m(e){var t="";switch(e.length){case 0:t="<sr-rd-content-error></sr-rd-content-error>";break;case 1:t=e.html().trim();break;default:t=e.map(function(e,t){return $(t).html()}).get().join("<br>")}return t}var b=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},g=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),
r&&e(t,r),t}}(),v=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},w=function e(t,n,r){null===t&&(t=Function.prototype);var a=Object.getOwnPropertyDescriptor(t,n);if(void 0===a){var i=Object.getPrototypeOf(t);return null===i?void 0:e(i,n,r)}if("value"in a)return a.value;var o=a.get;return void 0!==o?o.call(r):void 0},y=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=("undefined"==typeof t?"undefined":i(t))&&"function"!=typeof t?e:t},A=function(){return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,a=!1,i=void 0;try{for(var o,s=e[Symbol.iterator]();!(r=(o=s.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){a=!0,i=e}finally{try{!r&&s.return&&s.return()}finally{if(a)throw i}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),S=function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)},k={url:"",target:"",matching:[],name:"",title:"",desc:"",exclude:[],include:"",avatar:[],paging:[]},_=void 0,E=void 0,M=void 0,O=void 0,T=function(){function n(){var e,t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{global:[],custom:[],local:[]};b(this,n),this.url=(t=(e="/"!=(e=window.location.pathname)&&e.endsWith("/")?e=e.replace(/\/$/,""):e).replace(/\/[%@#.~a-zA-Z0-9_-]+$|^\/$/g,""),window.location.protocol+"//"+window.location.hostname+t+"/"),this.sites=r,this.current={},this.state="none",this.origins=[],this.mathjax=void 0,O=location.href}return g(n,[{key:"SetURL",value:function(e){var n,r=t(e),a=(n="/"!=(n=r.pathname)&&n.endsWith("/")?n=n.replace(/\/$/,""):n).replace(/\/[%@#.~a-zA-Z0-9_-]+$|^\/$/g,"");this.url=r.protocol+"//"+r.hostname+a+"/",O=e}},{key:"SetMinimatch",value:function(e){_=e}},{key:"SetRdability",value:function(e){E=e}},{key:"SetMarkdown",value:function(e){M=e}},{key:"isMathJax",value:function(){var e=this;return void 0==this.mathjax&&(this.mathjax=!1,$("body").find("script").each(function(t,n){n.type.startsWith("math")&&(e.mathjax=!0)})),this.mathjax}},{key:"MathJaxMode",value:function(){var e=c();if(-1!=e)return this.Newsite("read",e[0].outerHTML),this.dom=e[0],this.state="temp",e;var t=l();if(t&&""!=t.content){var n=f(t.content),r=n.id,a=n.cls,i=n.tag;return""!=r?"<"+i+' id="'+r+'">':""!=a?"<"+i+' class="'+a+'">':void 0}}},{key:"Readability",value:function(){try{var t=l();if(!t||""==t.content)throw"Readability error";this.Newsite("read",t.content,t.excerpt);var n=f(t.wrap),r=n.id,a=n.cls,i=n.tag;this.dom=""!=r?$("body").find("#"+r)[0]:""!=a?$("body").find("."+a.replace(/ /gi,"."))[0]:$("body").find(""+i)[0],this.state="temp"}catch(t){var o=c();-1!=o?(this.Newsite("read",o[0].outerHTML),this.dom=o[0],this.state="temp"):this.current.site=e(k)}}},{key:"Getsite",value:function(e,t){return this.sites[e].find(function(e){return e[0]==t})}},{key:"Getsites",value:function(){var e=this,t=[],n=function(){if(_(location.href,"file://**/*.txt")||_(location.href,"http*://**/*.txt"))return function(){var e=location.pathname.split("/").pop(),t="file:"==location.protocol?"local":"remote",n={name:"txtread::"+t,title:"<title>",desc:"",include:"<pre>",auto:!1,exclude:[]};return"remote"==t&&(n.include="",n.html=$("body pre").html().replace(/\n/gi,"<br>")),!$("title").html()&&$("head").append("<title>"+decodeURI(e.replace(".txt",""))+"</title>"),n}();if($($("body").children()[0]).is("pre")&&(_(location.href,"file://**/*.md")||_(location.href,"http*://**/*.md")))return function(){var e=location.pathname.split("/").pop(),t={name:"txtread::"+("file:"==location.protocol?"local":"remote"),title:"<title>",desc:"",include:"",auto:!1,exclude:[]},n=(new M.default.Converter).makeHtml($("body pre").text());return t.html=n,!$("title").html()&&$("head").append("<title>"+decodeURI(e.replace(".md",""))+"</title>"),t}();var e=/<\S+ (class|id)=("|')?[\w-_=;:' ]+("|')?>?$|<[^/][-_a-zA-Z0-9]+>?$/gi,t={name:$("meta[name='simpread:name']").attr("content"),url:$("meta[name='simpread:url']").attr("content"),title:$("meta[name='simpread:title']").attr("content"),desc:$("meta[name='simpread:desc']").attr("content"),include:$("meta[name='simpread:include']").attr("content"),exp:$("meta[name='simpread:exclude']").attr("content"),auto:$("meta[name='simpread:auto']").attr("content"),exclude:[]};if(t.name&&t.include){if(t.url&&!_(location.href,t.url))return;!t.title&&(t.title="<title>"),!t.desc&&(t.desc=""),!t.exp&&(t.exp=""),t.name="metaread::"+t.name,t.auto="true"==t.auto;var n=["title","desc","include","exp"].findIndex(function(n){return""!=t[n]&&!t[n].match(e)});return t.exclude.push(t.exp),delete t.exp,-1==n?t:void 0}}();if(this.current.url=this.url,n)this.current.auto=n.auto,this.current.url=n.url,delete n.auto,delete n.url,this.current.site=v({},n),this.current.site.name.startsWith("metaread::")&&(this.state="meta"),this.current.site.name.startsWith("txtread::")&&(this.state="txt");else if(d("local",new Map(this.sites.local),this.url,t),d("global",new Map(this.sites.global),this.url,t),d("person",new Map(this.sites.person),this.url,t),d("custom",new Map(this.sites.custom),this.url,t),t.length>0){var r=void 0;if(t.forEach(function(t){t[1].active&&(r=t,e.current.url=r[0],e.current.site=e.Safesite(v({},r[1]),r[2],r[0]),e.state="adapter")}),!r){var a=t[0];a[1].active=!0,this.current.url=a[0],this.current.site=this.Safesite(v({},a[1]),a[2],a[0]),this.state="adapter"}}else{var i=function(){if(location.pathname.includes("thread")||location.pathname.includes("forum.php")){if($(".t_f").length>0&&$(".favatar").find(".authi").length>0&&$(".avatar").find("img").length>0)return{avatar:[{name:"[[{$('.favatar').find('.authi')}]]"},{url:"[[{$('.avatar').find('img')}]]"}],include:"[[{$('.t_f')}]]"}}else if(/\/t\/[\w-]+\/\d+/.test(location.pathname)&&$("meta[name=generator]").attr("content").includes("discourse"))return{avatar:[{name:"[[{$('.topic-avatar').find('.a[data-user-card]')}]]"},{url:"[[{$('.topic-avatar').find('img')}]]"}],include:"[[{$('.cooked')}]]"};return-1}();-1!=i?(this.Newmultisite("read",i),this.state="temp"):this.Readability()}this.current.site.matching=t}},{key:"Addsites",value:function(e){var t=0;if(0==this.sites.global.length)this.sites.global=this.Formatsites(e),t=this.sites.global.length;else{var n=function(e,t){var n=new Map(t),r=[].concat(S(n.keys())),a=0;return e.map(function(e){r.includes(e[0])?r.includes(e[0]):a++}),{count:a,newsites:e}}(this.Formatsites(e),this.sites.global);t=n.count,this.sites.global=n.newsites}return t}},{key:"Addlocalsites",value:function(e){return this.sites.local=[].concat(S(e)),this.sites.local}},{key:"Addallsites",value:function(e){return this.sites={global:[].concat(S(e.global)),person:[].concat(S(e.person)),custom:[].concat(S(e.custom)),local:[].concat(S(e.local))},this.sites}},{key:"Newsite",value:function(e,t,n){var r={mode:e,url:window.location.href,site:{name:"tempread::"+window.location.host,title:"<title>",desc:"[[{$('meta[name=Description]').attr('content')||$('meta[name=description]').attr('content')}]]",include:"",exclude:[]}};t&&(r.site.html=t),this.current.mode=r.mode,this.current.url=r.url,this.current.site=this.Safesite(v({},r.site),"local",r.url),n&&(this.current.site.excerpt=n)}},{key:"Newmultisite",value:function(e,t){var n={mode:e,url:window.location.href,site:{name:"tempread::"+window.location.host,title:"<title>",desc:"",include:t.include,exclude:[],avatar:t.avatar}};this.current.mode=n.mode,this.current.url=n.url,this.current.site=this.Safesite(v({},n.site),"local",n.url)}},{key:"Updatesite",value:function(e,t,n){var r=this.sites[e].findIndex(function(e){return e[0]==t});-1==r&&(r=this.sites[e].length),this.sites[e].splice(r,1,n)}},{key:"Deletesite",value:function(e,t,n){var r=this.sites[e].findIndex(function(e){return e[0]==t});-1!=r&&this.sites[e].splice(r,1),n(r)}},{key:"Safesite",value:function(e,t,n){return e.url=n,e.target=t,""==e.name&&(e.name="tempread::"),(!e.avatar||0==e.avatar.length)&&(e.avatar=[{name:""},{url:""}]),(!e.paging||0==e.paging.length)&&(e.paging=[{prev:""},{next:""}]),e}},{key:"Cleansite",value:function(e){return delete e.url,delete e.html,delete e.target,delete e.matching,e.avatar&&e.avatar.length>0&&""==e.avatar[0].name&&delete e.avatar,e.paging&&e.paging.length>0&&""==e.paging[0].prev&&delete e.paging,e}},{key:"Formatsites",value:function(e){var t=new Map,n=!0,r=!1,a=void 0;try{for(var i,o=e.sites[Symbol.iterator]();!(n=(i=o.next()).done);n=!0){var s=i.value;if(0==p(s)){var u=s.url;delete s.url,t.set(u,s)}}}catch(e){r=!0,a=e}finally{try{!n&&o.return&&o.return()}finally{if(r)throw a}}return[].concat(S(t))}},{key:"Clearsites",value:function(e){e?this.sites[e]=[]:this.sites={global:[],custom:[],local:[]}}},{key:"Origins",value:function(e){var t=e.origins.map(function(e){return e.url});return(t=new Set(this.origins.concat(t))).forEach(function(e){""!=e.trim()&&e.trim().startsWith("http")&&e.trim().endsWith(".json")||t.delete(e)}),this.origins=[].concat(S(t)),this.origins}},{key:"Addorigins",value:function(e){return this.sites.custom=[].concat(S(e)),this.sites.custom}},{key:"Clearorigins",value:function(){var e=this.sites.custom.length;return this.sites.custom=[],e}}]),n}();return function(t){function n(e){b(this,n);var t=y(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,e));return t.version="0.0.4 build 210524",t.org_url=location.href,t.html={},t.plugin={},t.pure=!1,t.cleanup=!1,t}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+("undefined"==typeof t?"undefined":i(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(n,T),g(n,[{key:"Exist",value:function(){return this.org_url==location.href}},{key:"AddPlugin",value:function(e){this.plugin={minimatch:e.minimatch,pangu:e.pangu,beautify:e.beautify,stylesheet:e.style,rdability:e.rdability,markdown:e.markdown},w(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"SetMinimatch",this).call(this,this.plugin.minimatch),w(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"SetRdability",this).call(this,this.plugin.rdability),w(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"SetMarkdown",this).call(this,this.plugin.markdown)}},{key:"ReadMode",value:function(){var t,n,a,i,o;this.html=(t=this.current.site,n=e(t),a=r(""==t.title?"<title>":t.title),i=r(t.desc),o=r(t.include),n.title=""==t.title||"<title>"==t.title?$("head title").text():h(a),n.desc=function(e){if(void 0==e)return e;var t=e.length,n=e.indexOf("。")+1;return t>100&&(e=n>0?e.substr(0,n):e.substr(0,101)+"......"),e}(t.excerpt?t.excerpt:h(i)),n.include=""==t.include&&""!=t.html?t.html:h(o,"html"),n.avatar&&n.avatar.length>0&&""==n.avatar[0].name&&delete n.avatar,n.paging&&n.paging.length>0&&""==n.paging[0].prev&&delete n.paging,n.avatar&&n.avatar.forEach(function(e){var t=Object.keys(e).join(),n=e[t];e[t]=h(r(n),"html")}),n.paging&&n.paging.forEach(function(e){var t=Object.keys(e).join(),n=e[t];e[t]=h(r(n))}),n)}},{key:"TempMode",value:function(e,t){this.state="temp",this.dom=t,this.Newsite(e,t.outerHTML)}},{key:"GetDom",value:function(e,t){return h(r(e),t)}},{key:"Include",value:function(){var e=this.current.site.include,t=[],n=r(e);try{if(a(n)){var i=o(e),s=A(i,2),u=s[0],c=s[1];0==c?(e=e.replace(/\[\[{\$\(|}\]\]|\).html\(\)/g,""),t=$(o("[[["+e+"]]]")[0])):3==c&&(t=u)}else n&&(t=$("body").find(n))}catch(e){}return t}},{key:"Exclude",value:function(e){return function(e,t){var n=[],i="",s=!0,u=!1,c=void 0;try{for(var l,d=t[Symbol.iterator]();!(s=(l=d.next()).done);s=!0){var p=l.value;if(a(p)){var f=o(p),h=A(f,2),m=h[0],b=h[1];if(1==b)i=m;else if(2==b){var g=e.html().match(new RegExp(m,"g"));if(g&&g.length>0){var v=g.join("");i="*["+v+"]"}else i=void 0}else 3==b?m.remove():4==b&&m.remove()}else i=r(p);i&&n.push(i)}}catch(e){u=!0,c=e}finally{try{!s&&d.return&&d.return()}finally{if(u)throw c}}return n.join(",")}(e,this.current.site.exclude)}},{key:"Beautify",value:function(e){0!=e.children().length&&this.plugin.beautify&&(this.plugin.beautify.specTag(this.current.site.name,e),this.cleanup&&this.plugin.beautify.cleanHTML(e,this.pure,this.isMathJax()),this.plugin.beautify.specbeautify(this.current.site.name,e),this.plugin.beautify.removeSpareTag(this.current.site.name,e),this.plugin.beautify.htmlbeautify(e),this.plugin.beautify.commbeautify(this.current.site.name,e),this.plugin.beautify.imgBrokenReload(e))}},{key:"Format",value:function(e){this.plugin.pangu&&this.plugin.pangu.spacingElementByClassName(e)}},{key:"Utils",value:function(){return{dom2Xpath:s,xPath2Dom:u}}}]),n}()})},199:function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e){return localStorage[s+"-"+e]}function a(e,t){localStorage[s+"-"+e]=t}function i(e){localStorage.removeItem(s+"-"+e)}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s="simpread",u={VER:"version",COUNT:"count",FIRST:"firstload",PATCH:"patch-update"},c=5,l=void 0,d=function(){function e(){n(this,e)}return o(e,[{key:"Count",value:function(){var e=[r(u.COUNT)],t=e[0],n=void 0===t?0:t;return l=n,a(u.COUNT,++l),!(l>c&&(a(u.COUNT,0),1))}},{key:"Firstload",value:function(){var e=[r(u.FIRST)],t=e[0],n=void 0===t?"true":t;return"true"==n&&(a(u.FIRST,!1),!0)}},{key:"Version",value:function(e){a(u.VER,e)}},{key:"Patch",value:function(e,t){if("add"==e)a(u.PATCH,t);else{if("get"==e)return r(u.PATCH);"remove"==e&&i(u.PATCH)}}},{key:"curcount",get:function(){return l}}]),e}(),p=new d;t.default=p},200:function(e,t,n){"use strict";function r(e,t){i.browser.permissions.contains({permissions:e.permissions},function(n){0==n?chrome.permissions.request(e,function(e){t(e)}):t(n)})}function a(e,t){i.browser.permissions.remove({permissions:e.permissions},function(e){t(e)})}Object.defineProperty(t,"__esModule",{value:!0}),t.Remove=t.Get=void 0;var i=n(3);t.Get=r,t.Remove=a},387:function(e,t,n){"use strict";var r={GET:function(e,t){return this.request("GET",e,{},null,"text",t)},PROPFIND:function(e,t){return this.request("PROPFIND",e,{Depth:"1"},null,"xml",t)},MKCOL:function(e,t){return this.request("MKCOL",e,{},null,"text",t)},DELETE:function(e,t){return this.request("DELETE",e,{},null,"text",t)},PUT:function(e,t,n){return this.request("PUT",e,{},t,"text",n)},Author:function(e,t){this.user=e,this.password=t},request:function(e,t,n,r,a,i){var o=new XMLHttpRequest,s=function(){var e=o.responseText;if("xml"==a){var t=o.responseXML;t&&(e=t.firstChild.nextSibling?t.firstChild.nextSibling:t.firstChild)}return e};i&&(o.onreadystatechange=function(){if(o.readyState===XMLHttpRequest.DONE&&"PROPFIND"==e){var t=s();t&&i(t)}else o.readyState===XMLHttpRequest.DONE&&i(o)}),o.open(e,t,!!i),o.setRequestHeader("Content-Type","text/xml; charset=UTF-8"),this.user&&this.password&&o.setRequestHeader("Authorization","Basic "+btoa(this.user+":"+this.password));for(var u in n)o.setRequestHeader(u,n[u]);if(o.send(r),!i)return s()}};r.Fs=function(e,t,n){r.Author(t,n),this.rootUrl=e;var a=this;return this.file=function(e){return this.type="file",this.url=a.urlFor(e),this.name=a.nameFor(this.url),this.read=function(e){return r.GET(this.url,e)},this.write=function(e,t){return r.PUT(this.url,e,t)},this.rm=function(e){return r.DELETE(this.url,e)},this},this.dir=function(e){return this.type="dir",this.url=a.urlFor(e),this.name=a.nameFor(this.url),this.children=function(e){var t=function(e){if(null==e.childNodes)throw"No such directory: "+url;for(var t=[],n=1;n<e.childNodes.length;n++){var r=e.childNodes[n],i=decodeURI(r.getElementsByTagName("d:href")[0].firstChild.nodeValue.replace(/\/$/,"")),o=r.getElementsByTagName("d:propstat")[0],s=o.getElementsByTagName("d:prop")[0],u=s.getElementsByTagName("d:resourcetype")[0],c=u.getElementsByTagName("d:collection")[0];c?t[n-1]=new a.dir(i):t[n-1]=new a.file(i)}return t};return e?void r.PROPFIND(this.url,function(n){e(t(n))}):t(r.PROPFIND(this.url))},this.rm=function(e){return r.DELETE(this.url,e)},this.mkdir=function(e){return r.MKCOL(this.url,e)},this},this.urlFor=function(e){return/^http/.test(e)?e:this.rootUrl+e},this.nameFor=function(e){return e.replace(/.*\/(.*)/,"$1")},this},e.exports=r}});